/*
 * AqueousActivity.h
 *
 *  Created on: 19 Aug 2011
 *      Author: Allan
 */

#ifndef AQUEOUSACTIVITY_H_
#define AQUEOUSACTIVITY_H_

// C++ includes
#include <string>
#include <vector>
using namespace std;

// GeoReact includes
#include <Core/Activity.h>
#include <Geochemistry/ElectrolyteSolution.h>
#include <Utils/Types.h>

class AqueousActivity : public Activity
{
public:
	AqueousActivity();
	
	AqueousActivity(const string& species, const vector<string>& phase_species, const ActivityCoefficientFunction& activity_coefficient);
	
	virtual ~AqueousActivity();

	virtual const double activity(double T, double P, const VectorXd& n) const;
	
	virtual const double activityCoefficient(double T, double P, const VectorXd& n) const;
	
	virtual const VectorXd activityDerivatives(double T, double P, const VectorXd& n, const VectorXd& a) const;
	
protected:
	/// The index of the species in the aqueous solution for which the activity is being defined
	Index index_species;
	
	/// The index of water species in the aqueous solution
	Index index_water;
	
	/// The activity coefficient function
	ActivityCoefficientFunction activity_coefficient;
};

const AqueousActivity AqueousActivityIdealModel(const string& species, const ElectrolyteSolution& electrolyte_solution);

const AqueousActivity AqueousActivityHKFIonicModel(const string& ion, const ElectrolyteSolution& electrolyte_solution);

const AqueousActivity AqueousActivityHKFWaterModel(const ElectrolyteSolution& electrolyte_solution);

const AqueousActivity AqueousActivitySetschenowModel(const string& species, const ElectrolyteSolution& electrolyte_solution);

const AqueousActivity AqueousActivitySetschenowModel(const string& species, const ElectrolyteSolution& electrolyte_solution, double b);

const AqueousActivity AqueousActivitySetschenowModel(const string& species, const ElectrolyteSolution& electrolyte_solution, const vector<double>& bi, const vector<double>& Ti);

const AqueousActivity AqueousActivityDrummondCO2Model(const ElectrolyteSolution& electrolyte_solution);

const AqueousActivity AqueousActivityRumpfCO2Model(const ElectrolyteSolution& electrolyte_solution);

#endif /* AQUEOUSACTIVITY_H_ */
